function vitePluginTemplateInset(components) {
    let text = ''
    components?.forEach(item => {
        text += item
    })
    return {
        name: "vite-plugin-template-inset",
        transform(code:any, id:any) {
            if (/\.vue/.test(id) && /^\<template/.test(code)) {
                code = code.replace(/(\<template\>\s*\<.+?\>)/, `$1${text}`)
                return code
            }
        },
    }
}

export default vitePluginTemplateInset